#ifndef RESULTWINDOW_H
#define RESULTWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QPushButton>
#include <QString>
#include <QVector>
#include <QFile>
#include <QTextStream>
#include <QDate>
#include <QMessageBox>

class ResultWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit ResultWindow(double bmi, const QString &username = "", QWidget *parent = nullptr);
    
    double getLatestBmi() const;
    void showTrendPrediction();

signals:
    void requestAdvice();
    void requestGoalSetting();
    void requestHistory();
    void requestTrendPrediction();

private:
    double bmi;
    QString username;
    QLabel *bmiLabel;
    QLabel *assessmentLabel;
    QPushButton *saveBtn;
    QPushButton *adviceBtn;
    QPushButton *goalBtn;
    QPushButton *historyBtn;
    QPushButton *trendBtn;
    
    QVector<double> loadHistoricalBmi() const;
    QVector<double> predictFutureBmi(const QVector<double> &historicalBmi) const;
    const char* getBmiStatus(double bmi) const;
};

#endif // RESULTWINDOW_H